home *** CD-ROM | disk | FTP | other *** search
- ///////////////////////////////////////////////////////////////
- //
- // Module : INVSLCT.PRG
- //
- // Created by SUMMER'93 (c) on Fri Nov 26 14:51:30 1993
- //
- ///////////////////////////////////////////////////////////////
- #include "snj.ch"
- // The following vars were made static because they were 'inherited'
- // IVFLDS
- // The following statics were declared 'PUBLIC' in the S87 code
- // OR were private and inherited by called functions
- // If they are used outside this module there will be a set/get
- // function with the same name as the var in this module
- static IVFLDS [ 4 ]
- function INVOWNGT( SEEKVAR ) // Amended by SUMMER93
- // Calls: CTPRMT2 IVFUNC
- // Called By: GINVNO
- // I N V O W N G T
- // Routine to search out a customer
-
- // The following locals have been declared by Summer'93
- // KOUNT
- local IVFUNC, OLDSCR, IVHDRS [ 4 ], KOUNT
-
-
-
- save screen to OLDSCR
- select INVOICE
-
- IVHDRS[ 1 ] := "Invoice"
- IVFLDS[ 1 ] := "INVNO"
- IVHDRS[ 2 ] := "Owner name"
- IVFLDS[ 2 ] := "OWNNAME"
- IVHDRS[ 3 ] := "Reg. No"
- IVFLDS[ 3 ] := "REGNO"
- IVHDRS[ 4 ] := "Date in"
- IVFLDS[ 4 ] := "DATEIN"
- set softseek on
- set deleted on
- // Determine which index we're using and set a low limit
- if eof( ).or. empty( SEEKVAR )
- SEEKVAR := iif( isalpha(alltrim(SEEKVAR )).or. empty(SEEKVAR ), "!", ;
- " 1" )
- seek SEEKVAR
- else // Position in middle of screen - maybe
- KOUNT := 5
- do while INVOICE->INVNO <> 0 .and. KOUNT > 0 .and. !bof( )
- KOUNT := KOUNT - 1
- skip - 1
- enddo
- keyboard replicate( chr(24 ), 5 - KOUNT )
- endif
-
- @ 7, 10, 20, 64 box replicate( chr(177 ), 9 )
- @ 8, 12 clear to 19, 62
-
- set color to( COLBRIGHT() )
- do while !GETOUT()
- do CTPRMT2
- dbedit( 8, 12, 19, 62, IVFLDS, "IVFUNC", .t., IVHDRS, chr(196 ), chr(179 );
- )
- enddo
-
- GETOUT( .f. )
- restore screen from OLDSCR
- return( MINVNO() )
-
- //**********************************************************************
-
- function IVFUNC( MODE, FLD_PTR ) // Amended by SUMMER93
- // Calls: QBYESNO CTPRMT2
- // Called By: INVOWNGT
- // The following locals have been declared by Summer'93
- // ROWNO COLNO
- local CURREC, CURFLD, MEDSTR, ROWNO, COLNO
-
- CURREC := recno( )
- ROWNO := row( )
- COLNO := col( )
-
- QBKEY( lastkey( ) )
- clear typeahead
- do case
- case MODE < 4
- if INVOICE->INVNO = 0
- keyboard chr( 24 )
- endif
- return 1
- case QBKEY() = 27
-
- MOWNNAME( "" )
- MINVNO( 0 )
- GETOUT( .t. )
- return 0
- case QBKEY() = 13
- save screen
- CURFLD := IVFLDS[ FLD_PTR ]
- MEDSTR := INVOICE->&CURFLD
- set color to( COLFLASH() )
- @ ROWNO, COLNO say MEDSTR
- if QBYESNO( "Select this Invoice? (Y/N)" ) = "Y"
- MINVNO( INVOICE->INVNO )
- GETOUT( .t. )
- return 0
- endif
- set color to( COLBRIGHT() )
- restore screen
- otherwise
- clear typeahead
- do CTPRMT2
- return 1
- endcase
-
- return 0
- // End of file
-